<template>
	<view>
		<view class="wallet-box">
			<view class="title">我的余额</view>
			<view class="money">{{amount}}</view>
			<view class="detail" @click="$util.$navigateTo('./balanceDetail')"><text>明细</text><image src="../../static/usercenter/icon_zk.png"></image></view>
		</view>
		<view class="btn">
			<button @click="$util.$navigateTo('./recharge')">充值</button>
			<button @click="withdraw">提现</button>
		</view>
	</view>
</template>

<script>
	
	export default {
		data() {
			return {
				username:'',
				avatar:'',
				mobile:'',
				companyName:'',
				worktype:'',
				verify:-1,
				amount:0
			}
		},
		onLoad(){
			
		},
		
		onShow(){
			this.myInfo();
		},
		methods: {
		
			withdraw(){
				uni.navigateTo({
					url:'./withdrawal'
				})
			},
			myInfo(){
				let param = {
					
				}
				let that = this;
				this.$api.amount(param).then(res => {
					
					if(res.code == 1){
						that.amount = res.data;
					}
					console.info(res)
				})
			}
		}
	}
</script>

<style lang="scss">
	page{
		background: #F9F9F9;
	}
	.wallet-box{
		margin: 40rpx auto 70rpx;
		width: 590rpx;
		height: 200rpx;
		background: #FFFFFF;
		border-radius: 10rpx;
		padding: 40rpx;
		.title{
			font-size: 28rpx;
			color: #666666;
			margin-bottom: 37rpx;
		}
		.money{
			font-size: 70rpx;
			color: #333333;
		}
		.detail{
			float: right;
			image{
				width:33rpx;
				height: 33rpx;
				vertical-align: middle;
				margin-left: 10rpx;
			}
			text{
				font-size: 24rpx;
				color: #BFBFBF;
			}
		}
	}
	.btn{
		button{
			background: #37C2BC;
			color: #ffffff;
			width:670rpx;
			margin-top: 40rpx;
			margin-left: 20rpx;
		}
	}
</style>
